<%@ page import="pojo.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 33503
  Date: 2023/11/26
  Time: 20:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>学生信息</title>
  <style>
    table{
      width: 93.8%;
    }
    th{
      border: 1px solid #000000;
      text-align: center;
      padding: 15px 0;
      background-color: #66afe9;
      height: 40px;
      font-size: 22px;
      color: white;
    }
    td{
      border: 1px solid #000000;
      text-align: center;
      padding: 15px 0;
      height: 40px;
    }
    table tbody tr:hover{
      background-color: #a6e1ec;
    }
    #mytable th{
      text-align: center;
    }
    .content_input .my-input{/*搜索框样式*/
      margin-right: 20px;
      margin-top: 20px;
      width: 30%;
      height: 38px;
      border-radius: 5px;
      color: black;
      border: 1px solid #3388FF;
    }
    .content_input .search_btn{ /*按钮样式*/
      width: 80px;
      height: 40px;
      background-color:dodgerblue;
    }
    .content_input .search_btn:hover{ /*按钮覆盖样式*/
      background-color: #2e6da4;
      color: ivory;
    }
  </style>
</head>
<body>
<jsp:include page="teacher_menu.jsp"></jsp:include>
<div style="background-color: #66afe9;display: inline-block;margin-top: 10px;float: left;margin-left: 20%;height: 80px;width: 200px;text-align: center; border-radius:0px;">
  <h1 style="color:white;text-shadow: 2px 2px 2px dodgerblue;line-height: 40px;border-radius:2px;font-size: 25px">学生信息</h1>
</div>
<div style="margin-left: 35%;margin-top:10px;width: 60%;height:80px;background-color: #66afe9; ">
  <form style="padding-left: 10%"  action="${pageContext.request.contextPath }/findTeacherStudentByStudentName" method="POST">
    <div class="content_input">
      <%--<input class="my-input" type="text" name="s_id" id="s_id" placeholder="请输入学生学号" aria-label="Search">--%>
      <input class="my-input" type="text" name="s_name" id="s_name" placeholder="请输入学生姓名" aria-label="Search">
      <input class="btn btn-primary search_btn" type="submit" value="查询">
      <%--所有--%>
      <form style="padding-left: 10%" action="${pageContext.request.contextPath }/loadTeacherStudentList" method="POST">
        <input type="submit" value="所有" class="btn btn-primary search_btn">
      </form>
    </div>
  </form>
</div>
<div  style="margin-left: 20%;margin-top: 20px">
  <table id="mytable">
    <thead>
    <tr>
      <th>学号</th>
      <th>学生姓名</th>
      <th>学院</th>
      <th>班级</th>
      <th>联系方式</th>
    </tr>
    </thead>

    <tbody>
    <!--  展示学生信息-->
    <%
      List<Student> students=(List<Student>)session.getAttribute("get_teacherStudents");
      if(students==null||students.isEmpty()){
    %>
    <tr>
      <td colspan="5" style="text-align: center">数据为空</td>
    </tr>
    <%
    }else{
      for(Student s:students){
    %>
    <tr>
      <td><%=s.getS_id()%></td>
      <td><%=s.getS_name()%></td>
      <td><%=s.getCollege()%></td>
      <td><%=s.getS_class()%></td>
      <td><%=s.getS_phone()%></td>
    </tr>
    <%
        }}
    %>
    </tbody>
  </table>
</div>
</body>
</html>
